<template>
  <view class="commonTheme">
    <view class="ct-pic"></view>
    <view class="sheetForm siForm">
      <view class="si-inner">
        <view class="si-block">
          <view class="si-block-title t1"></view>
          <view class="sf-elem">
            <view class="sf-label required">主要研究方向</view>
            <view class="sf-option">
              <view class="sf-input sfInput">
                <input type="text" />
              </view>
            </view>
          </view>
        </view>
        <view class="si-block">
          <view class="si-block-title t2"></view>
          <view class="sf-elem">
            <view class="sf-label required">2024年主营业务收入（万元）</view>
            <view class="sf-option">
              <view class="sf-input sfInput">
                <input type="text" />
              </view>
            </view>
          </view>
          <view class="sf-elem">
            <view class="sf-label required">2024年研发投入（万元）</view>
            <view class="sf-option">
              <view class="sf-input sfInput">
                <input type="text" />
              </view>
            </view>
          </view>
        </view>
        <view class="si-block">
          <view class="si-block-title t3"></view>
          <view class="sf-elem">
            <view class="sf-label required">研发场地面积（平方米）</view>
            <view class="sf-option">
              <view class="sf-input sfInput">
                <input type="text" />
              </view>
            </view>
          </view>
          <view class="sf-elem">
            <view class="sf-label required">研发设备总数（台/套）</view>
            <view class="sf-option">
              <view class="sf-input sfInput">
                <input type="text" />
              </view>
            </view>
          </view>
          <view class="sf-elem">
            <view class="sf-label required">研发设备原值（万元）</view>
            <view class="sf-option">
              <view class="sf-input sfInput">
                <input type="text" />
              </view>
            </view>
          </view>
        </view>
        <view class="si-block">
          <view class="si-block-title t4"></view>
          <view class="sf-elem">
            <view class="sf-label required">固定研发人员（人）</view>
            <view class="sf-option">
              <view class="sf-input sfInput">
                <input type="text" />
              </view>
            </view>
          </view>
          <view class="sf-elem">
            <view class="sf-label required">固定研发人员中博士（人）</view>
            <view class="sf-option">
              <view class="sf-input sfInput">
                <input type="text" />
              </view>
            </view>
          </view>
          <view class="sf-elem">
            <view class="sf-label required">固定研发人员中高级职称（人）</view>
            <view class="sf-option">
              <view class="sf-input sfInput">
                <input type="text" />
              </view>
            </view>
          </view>
        </view>
        <view class="si-btn commonBtn" @tap="onSubmit">立即提交</view>
      </view>
    </view>
  </view>
</template>
<script>
import schema from 'async-validator'
export default {
  data() {
    return {
      value: 1,
      config: {
        n1: '主要研究方向',
        n2: '2024年主营业务收入（万元）',
        n3: '2024年研发投入（万元）',
        n4: '研发场地面积（平方米）',
        n5: '研发设备总数（台/套）',
        n6: '研发设备原值（万元）',
        n7: '固定研发人员（人）',
        n8: '固定研发人员中博士（人）',
        n9: '固定研发人员中高级职称（人）'
      },
      form: {
        name: '1'
      }
    }
  },
  methods: {
    onSubmit() {
      var descriptor = {
        name: {
          required: true,
          message: '姓名必填'
        }
      }

      this.formValid = new schema(descriptor)

      this.formValid.validate(this.form, (errors) => {
        if (!errors) {
          uni.showToast({
            title: `提交成功`
          })
        } else {
          let error = errors[0]
          uni.showToast({
            title: error.message,
            icon: 'none'
          })
        }
      })
    }
  },
  mounted() {}
}
</script>
